<%@page import="java.util.*"%>
<%@page import="QRCG.deneme"%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Create New Game</title>
</head>

<script src="datetimepicker_css.js"></script>

<body>
	<center>

		<%
			String name = (String) session.getAttribute("nickname");
		    session.setAttribute("nickname",name);


			int level_max = 5;
		%>

		<form name="NewGame" method="post" action="NewGameServe">

			<table width="1100" border="0" cellpadding="1" bgcolor=white>
				<tr>
					<td>
						<!-- TABLE logo and head -->
						<table width="1100" border="0" cellpadding="1" bgcolor=white>
							<tr>
								<td width="250" align="center"><img src="images/logo.png"
									width="130" height="130" /></td>
								<td align="left"><h2>QR-MARKS-THE-SPOT!</h2></td>

								<td align="center"
									style="font: bold 16px tahoma; text-decoration: none; color: #00000; padding: 5px;">Logged
									as <font color=red><%=name%></font>
								</td>

								<td align="center"
									style="font: bold 16px tahoma; text-decoration: none; color: #00000; padding: 5px;"><a
									href="LogOut.jsp"
									onclick="return loadIframe('ifrm', this.href)">Logout</a></td>
							</tr>

						</table> <!-- LINK TABLE -->


						<table width="1100" border="0" cellpadding="20" bgcolor="#D6E9F3">
							<tr>
								<td align="center"
									style="font: bold 16px tahoma; text-decoration: none; color: #00000; padding: 5px;">
									You are about to create a new game!</td>

							</tr>
						</table> <br> <br> <br>


						<table width="1100" border="0" cellpadding="1" bgcolor=white>


							<tr>

								<td width="10%" align="left"><b>Name</b></td>
								<td><input type="text" name="gamename" /></td>
							</tr>

							<tr>

								<td align="left"><b>Description</b></td>
								<td><input type="text" name="description" /></td>
							</tr>

							<tr>
								<td align="left"><b>Start Date</b></td>
								<td><input type="text" name="begin_date" id="f2"
									maxlength="10" /> <img src="images/cal.gif" alt=""
									onclick="javascript:NewCssCal('f2','yyyyMMdd')"
									style="cursor: pointer" /></td>
							</tr>

							<tr>
								<td align="left"><b>End Date</b></td>
								<td><input type="text" name="end_date" id="f3"
									maxlength="10" /> <img src="images/cal.gif" alt=""
									onclick="javascript:NewCssCal('f3','yyyyMMdd')"
									style="cursor: pointer" /></td>
							</tr>
							<tr>

								<td align="left"><b>Level</b></td>
								<td><SELECT name=level_count>
										<OPTION>How many Levels</OPTION>
										<%
											for (int i = 0; i < level_max; i++) {
										%>

										<OPTION><%=i + 1%></OPTION>
										<%
											}
										%>
								</SELECT></td>

							</tr>

							<%
								deneme conn = new deneme();
								conn.connect();
								ArrayList<HashMap<String, Object>> LocList = conn
										.get_all_locations();
								int num_of_loc = LocList.size();
								System.out.println(num_of_loc);
							%>


							<tr>

								<td align="left"><b>Location</b></td>
								<td><SELECT name=Loc>
										<OPTION>Select Location</OPTION>
										<%
											for (int i = 0; i < num_of_loc; i++) {
												HashMap<String, Object> map = (HashMap<String, Object>) LocList
														.get(i);
										%>

										<OPTION><%=map.get("location_name")%></OPTION>
										<%
											}
										%>
								</SELECT></td>
							</tr>

							<tr>

								<td align="left"><b>Activation</b></td>
								<td><SELECT name=activation>
										<OPTION>Set Status</OPTION>
										<OPTION>Active</OPTION>
										<OPTION>Inactive</OPTION>
								</SELECT></td>
							</tr>

							<tr>
								<td align="right"><input type="submit" value="Submit" /></td>


							</tr>




						</table>

					</td>


				</tr>


			</table>

		</form>
	</center>

</body>
</html>